class Pool
	
	PROB_HASH = {}
	
	def initialize(num)
	  @pool = []
	  (0..num).each do |i|
	    (i..num).each do |j|
	      @pool << Domino.new(i,j)
	     end
	  end
	end
	
	def empty?
		@pool.empty?
	end
	
	def size
		@pool.size
	end
	
	def dominoes
		@pool
	end
	
	def remove d
		t = @pool.delete(d)
	end

	def dup
    p = Pool.new 0
    dup_pool = @pool.inject([]){|memo, t| memo << t.dup; memo}
    p.send(:set_pool, dup_pool)
    p
  end
  
  private
  
  def set_pool(p)
    @pool = p
  end
	
end